package com.ruanyun.modular.ry.api.web;

import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.ruanyun.api.core.util.UserLoginToken;
import com.ruanyun.modular.ry.api.vo.req.FeedBackReqVo;
import com.ruanyun.modular.ry.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@CrossOrigin
@RestController
@RequestMapping("/api/feedback")
public class ApiFeedbackController extends RyController {


    @Autowired
    private FeedbackService feedbackService;

    /**
     * 添加意见反馈
     *
     * @param feedBackReqVo
     * @return
     */
    @UserLoginToken
    @PostMapping("/add")
    public ResponseData insert(@Valid @RequestBody FeedBackReqVo feedBackReqVo) {
        return this.feedbackService.insertFeedback(feedBackReqVo, getCustomerId());
    }
}
